package com.mybed.crm.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mybed.crm.mapper.NoticeMapper;
import com.mybed.crm.pojo.pojo.Business;
import com.mybed.crm.pojo.pojo.Notice;
import com.mybed.crm.result.PageResult;
import com.mybed.crm.service.NoticeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
//通知中心
public class NoticeServiceImpl implements NoticeService {

    private PageResult pageResult = new PageResult();

    @Autowired
    private NoticeMapper noticeMapper;
    /**
     * 查询通知是否已读
     * @param status
     * @return
     */
    @Override
    public PageResult selectNotice(Integer status) {
        IPage<Notice> page = new Page<>(1,10);
        IPage<Notice> iPage = noticeMapper.selectNotice(page,null,status);
        pageResult.insertData(iPage);
        return pageResult;
    }
}
